<?php
namespace Modules\Home\Controllers;

use Common\Models\XfhNoticeModel;

class IndexController extends ControllerBase {
  public function initialize() {
    parent::initialize();

    $this -> _checkLogin();
    $this -> view -> setLayout('index');
  }

  public function indexAction() {
    $this -> tag -> prependTitle('首页');

    $this -> view -> setVar('xfhNotice', XfhNoticeModel::findFirst([
      'conditions' => 'is_show = 1',
      'order' => 'create_time DESC'
    ]));
  }
}
